package chapter04.demo3;

/**
 * 抽象类
 */
abstract class Student {
    int id;
    String name;
    abstract void setID(int id);
    //    abstract int getId();
    //    abstract void setName(String name);
    //    abstract String getName();
    public void study() {
        System.out.println("我的天职是学习");
    }
}


//1. 抽象类可以直接聚成抽象类
abstract class Smallstudent extends Student {
}

//2.普通类继承抽象类
class SeniorStudent extends Student {
    void setID(int id) {
        this.id = id;
    }
}


public class Demo3 {
    public static void main(String[] arges) {
        SeniorStudent stu1 = new SeniorStudent();
        stu1.id = 1;
        stu1.name = "小明";
        stu1.study();
    }
}
